
package gui;

import java.awt.BorderLayout;
import java.awt.Button;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Panel;

public class UsandoPanel {
    
    public static void main(String args[]){
        Frame janela = new Frame("TESTE JANELA");
        janela.setSize(640, 480);
        Button btCentro = new Button("Centro");
        Button btNorte1 = new Button("Norte 1");
        Button btNorte2 = new Button("Norte 2");
        Button btSul = new Button("Sul");
        Button btLeste = new Button("Leste");
        Button btOeste = new Button("Oeste");
        
        Panel pNorte = new Panel(); // <-- por padrão o Panel é FlowLayout
        
        pNorte.setLayout(new GridLayout(1,2));
 
        pNorte.add(btNorte1);
        pNorte.add(btNorte2);
        
        janela.add(btCentro , BorderLayout.CENTER);
        //janela.add(btNorte , BorderLayout.NORTH);
        janela.add(pNorte,BorderLayout.NORTH);
        janela.add(btSul , BorderLayout.SOUTH);
        janela.add(btLeste , BorderLayout.EAST);
        janela.add(btOeste , BorderLayout.WEST);
        janela.setVisible(true);
    }
    
}
